<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/19
  Time: 9:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
    <script>
        $(function () {
            $("#text").click(function () {
                $.ajax({
                    type:"get",
                    url:"ajax",
                    data:{"name":"张三","age":17},
                    dataType:"text",
                    success:function (result) {
                        $("#msg").html(result);

                    }

                })

            })
        })
    </script>
</head>
<body>
<h2><%=new Date()%>></h2>
<button id="text" value="点击启动ajax">ajax</button>
<h2 id="msg"></h2>
</body>
</html>
